(function () {
    $.fn.extend({
        aaa() {
            class Swiper2 {
                constructor(el) {
                    this.el = el;
                    this.oul = this.el.find(".abox");
                    this.imgindex=0;
                    //图片的下标
                    this.mouseEvent();
                    this.click();
                }
                mouseEvent() {
                    this.el.mouseenter(() => {
                        this.el.find(".usall>span").show();
                    }).mouseleave(() => {
                        this.el.find(".usall>span").hide();
                    })
                }
                click() {
                    $(".solider-content").on("click", ".usall", (e) => {
                        if (e.target.className == "prev")
                            this.imgindex--;
                        if (this.imgindex < 0)
                            this.imgindex = 0;
                        if (e.target.className == "next")
                            this.imgindex++;
                        if (this.imgindex > 3)
                            this.imgindex = 3;
                            
                        this.oul.animate({
                            left: this.imgindex * -600
                        })
                    })

                }


            }
            new Swiper2(this)
        }
    })

})()




$(function () {
    $(window).load(function () {
        $(".solider-content").aaa();
    })
})

